package com.haiyou.dc.array;

import java.util.Arrays;

public class TestArray {

    public static void main(String[] args) {
        Integer[] arr = {1, 2, 4, 5, 6};
        System.out.println(Arrays.toString(arr));

        int size = arr.length;
        arr = Arrays.copyOf(arr, 10);
        System.out.println(Arrays.toString(arr));
//        arr[2]=3;
//        System.out.println(Arrays.toString(arr));

        int index = 0;
        System.arraycopy(arr, index, arr, index + 1, size - index);

        arr[index] = 0;
        System.out.println(Arrays.toString(arr));

        index = 3;
        System.arraycopy(arr, index, arr, index + 1, size + 1 - index);

        arr[index] = 3;
        System.out.println(Arrays.toString(arr));
    }
}
